import get from '@dfeidao/atom-web/global/get';
import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import nodejs from '@dfeidao/atom-web/msg/nodejs';
import render from '@dfeidao/atom-web/render/render';
import set_node_cls from '@dfeidao/atom-web/ui/set-node-cls';
import p003 from './p003';
export default async function a003(fd: IFeidaoAiBrowserComponent) {
	// todo
	const d1 = get('staff_no');
	// 设置接收人隐藏和显示全部和渲染接收人
	const zhankai = fd.data.node.querySelector<HTMLDivElement>('[data-id="zhankai"]');
	set_node_cls(zhankai, 'display-n', true);
	const suojin = fd.data.node.querySelector<HTMLDivElement>('[data-id="suojin"]');
	set_node_cls(suojin, 'display-n', false);
	const res3 = await nodejs<Array<{ pub_user_no: string, pub_user_name: string, length: number }>>
		('notification-notice/zj-000003/s003',
			{
				filter: {
					d: d1
				}
			});
	const num = 9;
	const data = res3.map((v) => {
		return { ...v, length: num };
	});
	const arr = Array();
	for (let i = 0; i < data.length; i++) {
		if (i < 8) {
			arr.push(data[i]);
		}
	}
	if (res3.length < 1) {
		render(fd, "", p003, 'p003', "inner");
	} else {
		render(fd, res3, p003, 'p003', "inner");
	}
}
